import DateUtils from "utils/DateUtils";
import DataType from "utils/DataType";

const Formatter = {
	dateFormat(date, dateType) {
		if (!DataType.isDate(date)) {
			return "";
		}
		if (dateType === "date") {
			return DateUtils.toLocalDateString(date);
		} else if (dateType === "time") {
			return DateUtils.toLocalTimeString(date);
		} else {
			return DateUtils.toLocalString(date);
		}
	}
};

export default Formatter;
